package PrimesNumbers;

public class PrimeNumber {
      boolean flag;
    String primeNumbers= "";

    public  String generatePrimeNumber(int Number)
    {
         primeNumbers="1" ;
        for(int i=2;i<=Number;i++)
        {
            flag=false;

            for (int j=2;j<i;j++)
            if(i%j==0)
            {
                flag=true;
                break;
            }

            if(flag==false)
                primeNumbers+=" "+i;
        }
        return primeNumbers;
    }
}
